﻿using System.Windows;

namespace SHomeWorkshop.LunarPresentation.Commands
{
    public partial class Command
    {
        public static void TurnOffMSPanels()
        {
            if (Globals.selectedEditor == null) return;
            if (Globals.selectedEditor.SelectedExpression == null) return;

            LunarPresentation.Expressions.Expression curEx
                = Globals.selectedEditor.SelectedExpression;

            if (curEx is Expressions.MSExpression)
            {
                Expressions.MSExpression ms = curEx as Expressions.MSExpression;
                ms.TurnOffMSPanel();
            }
            else
            {
                MessageBox.Show("此操作仅对拥有“主、从”两个子面板的公式有效！", Globals.appName,
                    MessageBoxButton.OK, MessageBoxImage.Warning);
                return;//子面板不支持Copy。
            }
        }
    }
}
